#include "PoolCue.h"

PoolCue::PoolCue() :
	Model()
,	m_force(0)
,	m_rotAngle(0)
{

}

void PoolCue::BuildIndexBuffer()
{

}

void PoolCue::BuildVertexBuffer()
{

}

void PoolCue::Draw(ID3DXSprite* sprite, D3DXMATRIX& view, D3DXMATRIX& proj)
{

}

void PoolCue::Update(float dt)
{
	Aim();
	Shoot();
}

void PoolCue::Aim()
{
	if (gDInput->keyDown(DIK_LEFTARROW))
	{
		m_rotAngle += 1.0f;
	}

	else if (gDInput->keyDown(DIK_RIGHTARROW))
	{
		m_rotAngle -= 1.0f;
	}

	//Apply the rotation en the transform of the PoolCue
}

void PoolCue::Shoot()
{
	if (gDInput->keyDown(DIK_SPACE))
	{
		m_force += 1.0f; //Multiplier par le deltaTime
	}

	if (gDInput->keyReleased(DIK_SPACE))
	{
		//Give the force to the White and call the "Impulse" function on it
		m_force = 0;
	}
}

PoolCue::~PoolCue()
{

}
